package com.ls.data.dao;


import com.ls.interPojo.Air;
import com.ls.interPojo.Cook;
import com.ls.pojo.InterThirdparty;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface InterfaceDao {

    @Select("select * from tb_cook where title=#{value}")
    List<Cook> findByMenu(String menu);

    @Insert("insert into tb_cook (id,title,tags,imtro,ingredients,burden,steps) values(#{id},#{title},#{tags},#{imtro},#{ingredients},#{burden},#{steps})")
    void insertCook(Cook cook);

    @Select("select * from tb_inter_req where interface_id=#{value}")
    List findCookReq(int id);

    @Select("select * from tb_inter_res where interface_id=#{value}")
    List findCookRes(int id);

    @Select("select appkey from tb_cust_inter where inter_id=#{value}")
    String findByInterfaceId(Integer interfaceid);

    @Select("select id from tb_interface where interface_url=#{value}")
    Integer findByUrl(String requestURL);

    @Select("select thirdparty_url,appkey from tb_inter_thirdparty where interface_id=#{value}")
    InterThirdparty findBythird(Integer interfaceId);

    @Select("select * from tb_air where city=#{value}")
    Air findBycity(String city);

    @Insert("insert into tb_air (city,citynow,lastTwoWeeks,lastMoniData) values(#{city},#{citynow},#{lastTwoWeeks},#{lastMoniData})")
    void insertAir(Air air);
}
